"""
该文件用于 编辑页面
"""
import uiautomation as auto
from page.base_page import BasePage
from utils.utils_log import loggerCase

class EditPage(BasePage):
    """编辑页面"""

    # 标志点编辑
    __edit_markers_button = auto.GroupControl(SubName="access_Edit Markers")

    # 数据编辑
    __edit_data_button = auto.GroupControl(SubName="access_Data editing")

    # 选择可见
    __select_visible_button = auto.GroupControl(SubName="access_Select Visible")

    # 选择贯通
    __select_through_button = auto.GroupControl(SubName="access_Select Through")

    # 长方形编辑
    __rectangular_button = auto.GroupControl(SubName="access_Rectangular")

    # 多边形编辑
    __polygon_button = auto.GroupControl(SubName="access_Polygon")

    # 套索编辑
    __lasso_button = auto.GroupControl(SubName="access_Lasso")

    # 直线编辑
    __line_button = auto.GroupControl(SubName="access_Line")

    # 笔刷编辑
    __paint_brush_button = auto.GroupControl(SubName="access_Paint Brush")

    # 选择全部
    __select_all_button = auto.GroupControl(SubName="access_Select all")

    # 撤销
    __unselect_button = auto.GroupControl(SubName="access_Unselect")

    # 连通域
    __connect_domain_button = auto.GroupControl(SubName="access_Connected Domain")

    # 反选
    __invert_button = auto.GroupControl(SubName="access_Invert")

    # 删除数据
    __delete_selected_button = auto.GroupControl(SubName="access_Delete selected data")

    # 撤销编辑
    __undo_button = auto.GroupControl(SubName="access_Undo")

    # 取消撤销编辑
    __redo_button = auto.GroupControl(SubName="access_Redo")

    # 取消编辑
    __cancel_edit_button = auto.GroupControl(SubName="access_Cancel Edit")

    # 运用编辑
    __apply_edit_button = auto.GroupControl(SubName="access_Apply Edit")

    def click_edit_markers_button(self, max_wait_time=3):
        """标志点编辑"""
        loggerCase.info("点击标志点编辑按钮")
        self.click(EditPage.__edit_markers_button, max_wait_time=max_wait_time)

    def click_edit_data_button(self, max_wait_time=3):
        """数据编辑"""
        loggerCase.info("点击数据编辑按钮")
        self.click(EditPage.__edit_data_button, max_wait_time=max_wait_time)

    def click_select_visible_button(self, max_wait_time=3):
        """选择可见"""
        loggerCase.info("点击选择可见按钮")
        self.click(EditPage.__select_visible_button, max_wait_time=max_wait_time)

    def click_select_through_button(self, max_wait_time=3):
        """选择贯穿"""
        loggerCase.info("点击选择贯穿按钮")
        self.click(EditPage.__select_through_button, max_wait_time=max_wait_time)

    def click_rectangular_button(self, max_wait_time=3):
        """选择方形编辑"""
        loggerCase.info("点击长方形编辑按钮")
        self.click(EditPage.__rectangular_button, max_wait_time=max_wait_time)

    def click_polygon_button(self, max_wait_time=3):
        """选择多边形编辑"""
        loggerCase.info("点击多边形编辑按钮")
        self.click(EditPage.__polygon_button, max_wait_time=max_wait_time)

    def click_lasso_button(self, max_wait_time=3):
        """选择套索编辑"""
        loggerCase.info("点击套索编辑按钮")
        self.click(EditPage.__lasso_button, max_wait_time=max_wait_time)

    def click_line_button(self, max_wait_time=3):
        """选择直线编辑"""
        loggerCase.info("点击直线编辑按钮")
        self.click(EditPage.__line_button, max_wait_time=max_wait_time)

    def click_paint_brush_button(self, max_wait_time=3):
        """选择笔刷编辑"""
        loggerCase.info("点击笔刷编辑按钮")
        self.click(EditPage.__paint_brush_button, max_wait_time=max_wait_time)

    def click_select_all_button(self, max_wait_time=3):
        """选择全部数据"""
        loggerCase.info("点击选择全部数据按钮")
        self.click(EditPage.__select_all_button, max_wait_time=max_wait_time)

    def click_unselect_button(self, max_wait_time=3):
        """取消选中数据"""
        loggerCase.info("点击取消选中数据按钮")
        self.click(EditPage.__unselect_button, max_wait_time=max_wait_time)

    def click_connect_domain_button(self, max_wait_time=3):
        """连通域"""
        loggerCase.info("点击连通域按钮")
        self.click(EditPage.__connect_domain_button, max_wait_time=max_wait_time)

    def click_invert_button(self, max_wait_time=3):
        """反选"""
        loggerCase.info("点击反选按钮")
        self.click(EditPage.__invert_button, max_wait_time=max_wait_time)

    def click_delete_selected_button(self, max_wait_time=3):
        """删除选中数据"""
        loggerCase.info("点击删除选中数据按钮")
        self.click(EditPage.__delete_selected_button, max_wait_time=max_wait_time)

    def click_undo_button(self, max_wait_time=3):
        """撤销"""
        loggerCase.info("点击撤销按钮")
        self.click(EditPage.__undo_button, max_wait_time=max_wait_time)

    def click_redo_button(self, max_wait_time=3):
        """取消撤销"""
        loggerCase.info("点击取消撤销按钮")
        self.click(EditPage.__redo_button, max_wait_time=max_wait_time)

    def click_cancel_edit_button(self, max_wait_time=3):
        """取消编辑"""
        loggerCase.info("点击取消编辑按钮")
        self.click(EditPage.__cancel_edit_button, max_wait_time=max_wait_time)

    def click_apply_edit_button(self, max_wait_time=3):
        """应用编辑"""
        loggerCase.info("点击应用编辑按钮")
        self.click(EditPage.__apply_edit_button, max_wait_time=max_wait_time)
        self.loading()